<?php
include($_SERVER['DOCUMENT_ROOT']."/inc/Function_index.php");
$cid = isset($_GET['cid'])?intval($_GET['cid']):0;
$gname = isset($_GET['gname'])?trim($_GET['gname']):"";
$cplx = isset($_GET['cplx'])?intval($_GET['cplx']):0;
$tag1 = isset($_GET['tag1'])?intval($_GET['tag1']):0;
$tag2 = isset($_GET['tag2'])?intval($_GET['tag2']):0;
$page = isset($_GET['page'])?intval($_GET['page']):1;
$gtype = isset($_GET['gtype'])?intval($_GET['gtype']):0;
$psize = 16;
$cinfo = get_cate_info($cid);
$cat2= menu(2);
$cat3= menu(3);
$taglist1 = taglist(1);
$taglist2 = taglist(2);

$goodlist = goodslist($page,$psize,$cid,$cplx,0,$tag1,$tag2,$gname,$gtype);
$num = goodsnum($cid,$cplx,0,$tag1,$tag2,$gname,$gtype);
$u = false;
$page1 = page1($num,$psize,$page,$_SERVER['PHP_SELF']."?cid=$cid&cplx=$cplx&tag1=$tag1&tag2=$tag2&gname=$gname&gtype=$gtype");
$tpl->assign("taglist1",$taglist1);
$tpl->assign("taglist2",$taglist2);
$tpl->assign("u",$u); 
$tpl->assign("cid",$cid); 
$tpl->assign("cplx",$cplx); 
$tpl->assign("tag1",$tag1); 
$tpl->assign("tag2",$tag2); 
$tpl->assign("gname",$gname); 
$tpl->assign("gtype",$gtype); 
$tpl->assign('results',$results);
$tpl->assign("cat2",$cat2);
$tpl->assign("cat3",$cat3);
$tpl->assign('glist',$goodlist);
$tpl->assign('num',$num);
$tpl->assign('psize',$psize);
$tpl->assign('page',$page1);
$tpl->assign('catarr',$catarr);
$tpl->show("catgory");
?>